home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19971216-19980424 / 000141_news@newsmaster….columbia.edu _Sat Jan 31 10:16:32 1998.msg < prev    next >
Internet Message Format  |  2020-01-01  |  6KB

  1. Return-Path: <news@newsmaster.cc.columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.35.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id KAA04912
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Sat, 31 Jan 1998 10:16:32 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id KAA23644
  7.     for kermit.misc@watsun; Sat, 31 Jan 1998 10:16:31 -0500 (EST)
  8. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  9. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  10. Newsgroups: comp.protocols.kermit.misc
  11. Subject: Re: Expect and Kermit (was: Re: frequent timeouts!)
  12. Date: 31 Jan 1998 15:16:29 GMT
  13. Organization: Columbia University
  14. Lines: 102
  15. Message-ID: <6avf8d$hmd$1@apakabar.cc.columbia.edu>
  16. References: <6ao98e$p4h$1@apakabar.cc.columbia.edu> <gerlachEnIuIF.K4L@netcom.com> <6aonud$42r$1@apakabar.cc.columbia.edu> <gerlachEnK1G9.IBG@netcom.com>
  17. NNTP-Posting-Host: watsun.cc.columbia.edu
  18. Xref: news.columbia.edu comp.protocols.kermit.misc:8324
  19.  
  20. In article <gerlachEnK1G9.IBG@netcom.com>,
  21. Matthew H. Gerlach <gerlach@netcom.com> wrote:
  22. : In article <6aonud$42r$1@apakabar.cc.columbia.edu>
  23. : fdc@watsun.cc.columbia.edu (Frank da Cruz) writes:
  24. : >In article <gerlachEnIuIF.K4L@netcom.com>,
  25. : >Matthew H. Gerlach <gerlach@netcom.com> wrote:
  26. : >: The kermit scripting language is a greate thing, most notably the fact
  27. : >: that kermit scripts will run on many platforms.  That being said I find
  28. : >: it very beneficial to control C-Kermit from Expect, and I work for a
  29. : >: company that does a lot of it.  The main benefit is that one might need
  30. : >: to write a script that controls many serial connections in conjuction
  31. : >: with many connections to regular UNIX programs.  This appears to be
  32. : >: easier with Expect.
  33. : >:
  34. : >Some concrete examples might be instructive.
  35. : Since I am a consultant for the company I mention above, I can't show code,
  36. : but I will try to explain what they do.  In short they have a UNIX box
  37. : that performs automated telephony testing.  This testing involves two 
  38. : separate pieces.  One piece controls the end user's telephony equipment
  39. : via a serial port.  The other piece is the actual voice frequency testing
  40. : involved with DSP's.  The interface to voice frequency testing is an 
  41. : interactive program.  So the scripts usualy send some commands to the
  42. : telephone equipment, and once it is all set up, some commands get sent
  43. : to the voice testing program.  So the Expect scripts coordinates the serial
  44. : stuff with the DSP stuff.
  45. And of course a Kermit script can do that too, and more portably (since
  46. Kermit runs more places that Expect does), and without the problems inherent
  47. in interfacing two programs to do what one could do.
  48.  
  49. (For those who haven't been keeping up with recent Kermit releases, the
  50. Kermit script language is much more powerful than it was a few years ago.)
  51.  
  52. : At this point it is probably worth noting, that the company I mention was
  53. : too cheap to pay for kermit to put on released product; so it "talks" to cu.
  54. : However, in house we tend to use kermit, because it's easier to use and has
  55. : the wonderful "log session" feature.  I use kermit exclusively just because
  56. : it is a great piece of software that is also well documented. I own copies
  57. : of both revs of the book.
  58. Thanks.
  59.  
  60. : Yes this is a very useful dialog, because we are discussing interesting
  61. : ways to use kermit :)  As you say Expect is basically a screen-scaper.
  62. : For those who are interested, Expect is an extension to the TCL scripting
  63. : language.  The Expect extention simply spawns the desired program and
  64. : opens a pseudo-tty to the STDIN/STDOUT of the child, in this case Kermit.
  65. : The TCL scripting language does have the usual IF-ELSE, FOR and WHILE, 
  66. : subroutines and stuff.
  67. :
  68. Of course lots of languages have these features.  The salient question is:
  69. do they also have the built-in serial and networking i/o capabilities?
  70.  
  71.   The expect command itself looks an awful lot like
  72. : the use of minput followed by a switch.  As you point, however, 
  73. : the kermit commands return a status that can be tested by 
  74. : IF SUCCESS/FAILURE.  This information does not appear to be available to 
  75. : Expect unless there is a kermit command like "print status of last command". 
  76. : Is that a feature request?
  77. If you REALLY want to control Kermit with Expect or Tcl or Perl, then yes,
  78. you can tell Kermit to "show status" after each and every command, and then
  79. look for the word SUCCESS or FAILURE.  I think a program that does this will
  80. start to look pretty silly, compared to how it would look as a native Kermit
  81. program.
  82.  
  83. : At this point I would like by throwing out yet another scripting
  84. : language, Perl.  One can do the same thing in Perl as one does with
  85. : Expect, and that is what I personally do because I find Perl to be
  86. : a much more powerful programming language.  Another interesting point
  87. : is that a common question to the perl news group is "how do I control
  88. : a serial port from perl"?  Well, I always tell them, have Perl "talk"
  89. : to kermit!  I think now I will tell them, have perl talk to kermit scripts.
  90. And then the next step is to remove Perl from the equation and do it all in
  91. Kermit :-)∩┐╜ Because you didn't need Perl (or Tcl or Expect) in the first
  92. place, except if you wanted to layer a curses or GUI interface over your
  93. script Kermit (and yes, that's yet another item that's on our long, long,
  94. long list).
  95.  
  96. Again, just so it's clear:  Kermit scripts are portable among:
  97.  
  98.  . Windows 95, 98, and NT
  99.  . UNIX - *all* varieties (hundreds of them, not just the big names)
  100.  . UNIX relatives like OS-9, QNX, Plan 9, BeBox BeOS, etc.
  101.  . DEC (Compaq) VMS (OpenVMS)
  102.  . OS/2
  103.  . Stratus VOS
  104.  . AOS/VS and AOS/VS-II
  105.  
  106. And also (with a little care) to:
  107.  
  108.  . DOS
  109.  . Windows 3.x
  110.  
  111. And to any other platform that C-Kermit will be ported to in the future.
  112. They work not only over serial connections, but in most cases also TCP/IP
  113. Telnet or Rlogin (or any other TCP service), and in some cases also X.25,
  114. NETBIOS, DECnet (LAT or CTERM), and various other networking methods.
  115.  
  116. - Frank